package me.tgl.demo1.mapper;

import me.tgl.demo1.model.User;
import org.apache.ibatis.annotations.*;

/**
 * Created by Administrator on 2017/7/17.
 */
@Mapper
public interface UserMapper {
    @Select("select * from users where id = #{id}")
    User getById(@Param("id") Long id);

    @Insert("insert into users(id,name,age) values(#{id}, #{name}, #{age})")
    int insert(User user);

    @Update("update users set name=#{user.name}, age=#{user.age} where id = #{id}")
    int update(@Param("id") Long id, @Param("user") User user);
}
